/*
 * map_saver
 * Copyright (c) 2008, Willow Garage, Inc.
 * All rights reserved.

 */

#include <cstdio>
#include "ros/ros.h"
#include "ros/console.h"
#include "nav_msgs/GetMap.h"
#include "LinearMath/btMatrix3x3.h"
#include "geometry_msgs/Quaternion.h"

using namespace std;
 
/**
 * @brief Map generation node.
 */
class MapGenerator 
{

  public:
    MapGenerator(const std::string& mapname) : mapname_(mapname)
    {
      ros::NodeHandle n;
      ROS_INFO("Waiting for the map");
      map_sub_ = n.subscribe("map", 1, &MapGenerator::mapCallback, this);
    }

    void mapCallback(const nav_msgs::OccupancyGridConstPtr& map)
    {
      ROS_INFO("Received a %d X %d map @ %.3f m/pix",
               map->info.width,
               map->info.height,
               map->info.resolution);
    }
    ros::Subscriber map_sub_;
    std::string mapname_;
};

int main(int argc, char** argv) 
{
  ros::init(argc, argv, "map_reader");
  std::string mapname = "map";
  
  MapGenerator mg(mapname);
    ros::spin();
  return 0;
}


